package com.zhisuo.apicenter.model;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class ZhiSuoCarStatusRowMapper implements RowMapper<ZhiSuoCarStatus> {

    @Override
    public ZhiSuoCarStatus mapRow(ResultSet rs, int rowNum) throws SQLException {
        ZhiSuoCarStatus car = new ZhiSuoCarStatus();
        car.setId(rs.getInt("id"));
        car.setName(rs.getString("name"));
        car.setVin(rs.getString("vin"));
        car.setUpdate_time(rs.getTimestamp("update_time"));
        car.setVehicleinfostatus(rs.getString("vehicleinfostatus"));
        car.setVehicleinfoerrorcode(rs.getString("vehicleinfoerrorcode"));
        car.setPositionstop(rs.getString("positionstop"));
        car.setPositionlon(rs.getString("positionlon"));
        car.setPositionlat(rs.getString("positionlat"));
        car.setPositionheading(rs.getString("positionheading"));
        car.setSpeedvalue(rs.getString("speedvalue"));
        car.setSpeedunit(rs.getString("speedunit"));
        car.setBatterysoc(rs.getString("batterysoc"));
        car.setBatteryrangevalue(rs.getString("batteryrangevalue"));
        car.setBatteryrangeunit(rs.getString("batteryrangeunit"));
        car.setBatterypowervalue(rs.getString("batterypowervalue"));
        car.setBatterypowerunit(rs.getString("batterypowerunit"));
        car.setStatus(rs.getInt("status"));
        car.setCreate_time(rs.getTimestamp("create_time"));
        car.setRemaintotal(rs.getString("remaintotal"));
        car.setDistancetotal(rs.getString("distancetotal"));
        return car;
    }

}
